<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>The implementation of Huffman coder: com.twogen.it.coder.test.Main Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="me_2.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The implementation of Huffman coder
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">Bangjie Mo</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>twogen</b></li><li class="navelem"><b>it</b></li><li class="navelem"><a class="el" href="namespacecom_1_1twogen_1_1it_1_1coder.html">coder</a></li><li class="navelem"><a class="el" href="namespacecom_1_1twogen_1_1it_1_1coder_1_1test.html">test</a></li><li class="navelem"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html">Main</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.twogen.it.coder.test.Main Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a8758ffc3aa4241d6cdf749ab85c75442"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8758ffc3aa4241d6cdf749ab85c75442"></a>
static void&#160;</td><td class="memItemRight" valign="bottom"><b>main</b> (String[] args)</td></tr>
<tr class="separator:a8758ffc3aa4241d6cdf749ab85c75442"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b21bf8b66bed5fec6f9b0bae3ed470c"><td class="memItemLeft" align="right" valign="top">static double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html#a3b21bf8b66bed5fec6f9b0bae3ed470c">statistic</a> (File file)</td></tr>
<tr class="separator:a3b21bf8b66bed5fec6f9b0bae3ed470c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35d0f180f15a42c4dc1147376677a4d0"><td class="memItemLeft" align="right" valign="top">static double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html#a35d0f180f15a42c4dc1147376677a4d0">statistic</a> (String s)</td></tr>
<tr class="separator:a35d0f180f15a42c4dc1147376677a4d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7672a8d9140d9bc2e19553b7a0655e6"><td class="memItemLeft" align="right" valign="top">static double[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html#ac7672a8d9140d9bc2e19553b7a0655e6">prehandle</a> (int base, double...probabilities)</td></tr>
<tr class="separator:ac7672a8d9140d9bc2e19553b7a0655e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af65b0df9408b6dd1d69cf83e93f6057e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html#af65b0df9408b6dd1d69cf83e93f6057e">sort</a> (double[] probabilities)</td></tr>
<tr class="separator:af65b0df9408b6dd1d69cf83e93f6057e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1c9bd47ba8407b6da9b2cc9eb36eb14"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1test_1_1_main.html#aa1c9bd47ba8407b6da9b2cc9eb36eb14">println</a> (Object o)</td></tr>
<tr class="separator:aa1c9bd47ba8407b6da9b2cc9eb36eb14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13bedf6903de6c2156bd83473c118f4a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a13bedf6903de6c2156bd83473c118f4a"></a>
static void&#160;</td><td class="memItemRight" valign="bottom"><b>println</b> ()</td></tr>
<tr class="separator:a13bedf6903de6c2156bd83473c118f4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a5ca4d7b3565b6706ed919b89031383fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5ca4d7b3565b6706ed919b89031383fd"></a>
static final String&#160;</td><td class="memItemRight" valign="bottom"><b>FILE_PATH</b> = &quot;G:\\java\\project\\huffman\\src\\com\\twogen\\it\\coder\\test\\article.txt&quot;</td></tr>
<tr class="separator:a5ca4d7b3565b6706ed919b89031383fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38ca68354ac049be5715024d57d9bb1d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38ca68354ac049be5715024d57d9bb1d"></a>
static final int&#160;</td><td class="memItemRight" valign="bottom"><b>BASE</b> = 2</td></tr>
<tr class="separator:a38ca68354ac049be5715024d57d9bb1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8615d0d3ac23e8fe92373793940f9ed"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af8615d0d3ac23e8fe92373793940f9ed"></a>
static final Collection&lt; Character &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>SYMBOLSET</b> = new <a class="el" href="classcom_1_1twogen_1_1it_1_1coder_1_1util_1_1_digit_char_symbol_set.html">DigitCharSymbolSet</a>(BASE)</td></tr>
<tr class="separator:af8615d0d3ac23e8fe92373793940f9ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>实验内容：<br />
 1、给出信源符号的概率统计分布，并计算信源熵<br />
 2、给出两种以上单信源符号Huffman码表<br />
 3、计算每信源的平均字长，并与信源熵比较<br />
 4、计算编码效率，分析码长方差对实验系统的影响<br />
 </p><dl class="section author"><dt>Author</dt><dd>帮杰 </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ac7672a8d9140d9bc2e19553b7a0655e6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double [] com.twogen.it.coder.test.Main.prehandle </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double...&#160;</td>
          <td class="paramname"><em>probabilities</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>预处理<br />
 如果待编码符号数s不满足s=(base-1)*m+base，则填充最少的0使满足 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">probabilities</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="aa1c9bd47ba8407b6da9b2cc9eb36eb14"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void com.twogen.it.coder.test.Main.println </td>
          <td>(</td>
          <td class="paramtype">Object&#160;</td>
          <td class="paramname"><em>o</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>打印 </p>

</div>
</div>
<a class="anchor" id="af65b0df9408b6dd1d69cf83e93f6057e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void com.twogen.it.coder.test.Main.sort </td>
          <td>(</td>
          <td class="paramtype">double[]&#160;</td>
          <td class="paramname"><em>probabilities</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>降序排序 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">probabilities</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3b21bf8b66bed5fec6f9b0bae3ed470c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double [] com.twogen.it.coder.test.Main.statistic </td>
          <td>(</td>
          <td class="paramtype">File&#160;</td>
          <td class="paramname"><em>file</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>从文本文件中统计出信源分布。统计26个英文字母，其他当空格处理。 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a35d0f180f15a42c4dc1147376677a4d0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double [] com.twogen.it.coder.test.Main.statistic </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>从原始字符串中统计出信源分布。统计26个英文字母，其他当空格处理。 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>G:/java/project/huffman/src/com/twogen/it/coder/test/Main.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
